Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

188651494 pixi js integration #1697

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Conversation

nstclair-cc
Copy link
Collaborator

@nstclair-cc nstclair-cc commented Dec 20, 2024

PT-#188651494

Summary

This PR introduces improvements and proof-of-concept tests using PixiJS for graph and map interactions in CODAP v3. We’ve added multiple checks, tools, and tests to enhance our ability to debug and validate graphical behaviors.


New Features

1. Point Selection and Coloring in Graphs and Maps
• Added functionality to validate coloring of points (e.g., selection, legend plots).
• Example proof-of-concept tests now check:
• Colors of points are as expected.
• Colors are valid hex codes (e.g., #4682B4, #E6805B).


2. Counting Points in Graphs and Maps
• Implemented logic to count the number of points in a graph dynamically.
• Validates expected point counts in various scenarios, such as parent-child grouping and attribute selections.


3. Checking Position of Points in Graphs and Maps
• Implemented logic to check the (x, y) position of points in a graph or map.
• Validates expected position in various scenarios, such as undo redo.


4. Debugger Statement
• Introduced a new debugger tool to make it easier to inspect PixiJS point metadata.
• In the browser Console, you can call pixiPointsMap to access the array of Pixi points.


Tests Added

1. Proof-of-Concept Tests
Included tests for new functionality, such as:
• Point selection validation (with colors).
• Attribute grouping with dynamic point counting.
• Graph updates after selection, hierarchy, and legend interactions.
• Point (x, y) position.

2. PixiJS Checks
Multiple checks added that check:
• Colors of points are accurate and match expectations.
• Graphs update correctly after selections and attribute changes.
• Graph legends and plots dynamically adapt.
• Added logs for pixiPoints, textures, and fill values for better visibility (this is because we don't have visibility with the canvas element; logs help the developer get feedback on the issue when tests fail)


How to Use the Debugger
1. Open the graph or map component.
2. In the Console, call pixiPointsMap after enabling the debugger with Key: debug and Value: pixiPoints.
3. Inspect pixiPointsMap to view point metadata (e.g., texture, position).

Next Steps
• These changes lay the groundwork for:
• Extending point-coloring logic for additional use cases.
• Enhancing legend interactions for categorical attributes.


Proof of Concept in Action

Here’s an example of what’s now possible:
• Validate graph points are colored correctly.
• Validate graph points are in correct position.
• Verify dynamic updates when selecting attributes or grouping data.
• Debug PixiJS behavior directly in the Console with a single statement.

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.52%. Comparing base (9d9c21b) to head (7b3ca2e).
Report is 106 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1697      +/-   ##
==========================================
+ Coverage   68.07%   69.52%   +1.44%     
==========================================
  Files         607      607              
  Lines       30810    30823      +13     
  Branches     8509     8451      -58     
==========================================
+ Hits        20975    21430     +455     
+ Misses       9227     8795     -432     
+ Partials      608      598      -10     
Flag Coverage Δ
cypress 44.73% <100.00%> (+0.85%) ⬆️
jest 53.28% <30.76%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cypress bot commented Dec 20, 2024

codap-v3    Run #5709

Run Properties:  status check passed Passed #5709  •  git commit 7b3ca2e2f1: include linting and jest tests alongside cypress pixi tests
Project codap-v3
Branch Review 188651494-pixiJS-integration
Run status status check passed Passed #5709
Run duration 05m 09s
Commit git commit 7b3ca2e2f1: include linting and jest tests alongside cypress pixi tests
Committer nstclair-cc
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 18
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 18
View all changes introduced in this branch ↗︎

- Specified the cypress/e2e/pixi-interaction/**/*.ts pattern for the Cypress step.
- Removed: Save Webpack Cache step.
- Removed: Upload coverage to Codecov step.
- Updated: spec: property to accept the pattern cypress/e2e/smoke/**/*.ts, allowing multiple tests in the smoke folder.
@nstclair-cc nstclair-cc requested a review from eireland December 24, 2024 00:35
@nstclair-cc nstclair-cc marked this pull request as ready for review December 24, 2024 01:03
Copy link
Member

@scytacki scytacki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting closer. I left some comments of things to change so we can see if the cypress tests will run in GitHub Actions.

# set repository so we don't have to check out all of the code
GH_REPO: ${{github.repository}}

cypress:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cypress section, a GitHub Actions "job", needs to be indented to the same spot as re_run:.
I found that by looking for the log of running this workflow: https://github.com/concord-consortium/codap/actions/runs/12474798288

Since the workflow isn't running yet it is hard to know if there are other things broken.

@@ -0,0 +1,55 @@
name: Regression Label
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be renamed to something like "Graph Pixi Tests".
That will make it easier to tell if it is working or not. It currently has the same name as another workflow.

Below are the results right now. This workflow is the one with the on: push below it. It doesn't have any running jobs because of the syntax error (see comment below).
image

@nstclair-cc nstclair-cc requested a review from scytacki January 7, 2025 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants